<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../lib/bootstrap-3.3.5-dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="../css/top.css">
  <script src="../lib/bootstrap-3.3.5-dist/css/bootstrap.min.css"></script>
  <script src="../lib/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
  <link rel="stylesheet" href="../css/shouye_qiye.css">
  <link rel="stylesheet" href="../font/iconfont.css">

</head>

<body>
  <div class="container-fluid">
    <!-- 顶部 -->
    <div class="row top">
      <div class="col-md-3 col-md-offset-1">
        <ul>
          <li>
            <span class="iconfont icon-shouji"></span>
          </li>
          <li>
            <span>小阳招聘系统</span>
          </li>
          <li>
            <select name="" id="">
              <option value="">广州市</option>
            </select>
          </li>
        </ul>
      </div>
      <div class="col-md-3 col-md-offset-4">
      </div>
    </div>
    <!-- 导航栏 -->
    <div class="row nav">
      <img src="../images/logo.png" alt="#">
      <ul>
        <li id="shouye"><a href="./shouye_qiye.html">首页</a></li>
        <li><a href="./zhaogongzuo.html">找工作</a></li>
      </ul>
    </div>
  </div>

  <div id="back">

    <div class="container-fluid" id="search">

      <div class="row  ">
        <!-- 当前地址 -->
        <div class='col-md-2'></div>
        <div class='col-md-2'>
          <select name="" id="">
            <option value="">当前地址</option>
          </select>
        </div>

        <!-- 查询内容 -->
        <div class="col-md-3">
          <div class="col-md-3">
            <input type="text" placeholder="请输入内容">
          </div>
        </div>
        <!-- 选择行业 -->
        <div class="col-md-2">
          <select name="" id="">
            <option value="">选择行业</option>
          </select>
        </div>
        <!-- 搜索 -->
        <div class="col-md-1">
          <button><span class="iconfont icon-sousuo"></span>搜索</button>
        </div>
      </div>
    </div>

  </div>


  <div class="sp">
    <span id="qiye">|</span>
    <span>推荐企业</span>
  </div>
  <div class="container-fluid" id='imge'>
    <div class="row">
      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u793.png" alt="" id="one">
        </div>
        <div>
          <img src="../images/shouye_qiye/u794.png" alt="" id="ones">
        </div>
      </div>

      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u797.png" alt="">
        </div>
        <div>
          <img src="../images/shouye_qiye/u798.png" alt="" id="two">
        </div>
        <div>
          <img src="../images/shouye_qiye/u799.png" alt="">
        </div>
      </div>

      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="three">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="four">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
      </div>
      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="three">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="four">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
      </div>
      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="three">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="four">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
      </div>
      <div class="col-md-2">
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="three">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="" class="four">
        </div>
        <div>
          <img src="../images/shouye_qiye/u800.png" alt="">
        </div>
      </div>
    </div>
  </div>
  <div class="line"></div>

  <div class="container-fluid">
    <div class="row">
      <div class="col-md-5">
        <div class="sp">
          <span>|</span>
          <span>找工作</span>
          <span>热门职位</span>
          <span>最新职位</span>
        </div>
      </div>
      <div class="col-md-6"></div>
      <div class="col-md-1">
        <div id="more">
          <span>更多</span>
        </div>

      </div>
    </div>
  </div>

  <div class="container-fluid" id="flu">
    <div class="row">
      <div class="col-md-2"></div>

      <div class="col-md-2 bode" onclick="checkbox(this)">

        <div class="foct">

          <!-- <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>
          </div> -->

        </div>


      </div>
      <div class="col-md-1"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- 
          <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>

          </div> -->
        </div>
      </div>

      <div class="col-md-1"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>

          </div> -->
        </div>
      </div>

    </div>
  </div>

  <div class="container-fluid">
    <div class="row">
      <div class="col-md-2"></div>

      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>

          </div> -->
        </div>
      </div>
      <div class="col-md-1"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>

          </div> -->
        </div>
      </div>

      <div class="col-md-1"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
          <span>[2018-06-30]</span>
          <span>3k-6k</span>
          <p>经验1-3年/无学历要求/广州-天河</p>
          <div class="row">
            <div class="col-md-4">
              <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
            </div>
            <div class="col-md-8 mds">
              <p>广州新邦物流有限公司</p>
              <div>
                <span>张三/招聘主管</span>
                <span class="iconfont icon-xiaoxi"></span>
              </div>
            </div>

          </div> -->
        </div>
      </div>

    </div>
  </div>


  //

  <div class="container-fluid col">
    <div class="row">
      <div class="col-md-2"></div>

      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
        <span>[2018-06-30]</span>
        <span>3k-6k</span>
        <p>经验1-3年/无学历要求/广州-天河</p>
        <div class="row">
          <div class="col-md-4">
            <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
          </div>
          <div class="col-md-8 mds">
            <p>广州新邦物流有限公司</p>
            <div>
              <span>张三/招聘主管</span>
              <span class="iconfont icon-xiaoxi"></span>
            </div>
          </div>

        </div> -->
        </div>
      </div>
      <div class="col-md-1"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
        <span>[2018-06-30]</span>
        <span>3k-6k</span>
        <p>经验1-3年/无学历要求/广州-天河</p>
        <div class="row">
          <div class="col-md-4">
            <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
          </div>
          <div class="col-md-8 mds">
            <p>广州新邦物流有限公司</p>
            <div>
              <span>张三/招聘主管</span>
              <span class="iconfont icon-xiaoxi"></span>
            </div>
          </div>

        </div> -->
        </div>
      </div>

      <div class="col-md-1 add"></div>
      <div class="col-md-2 bode" onclick="checkbox(this)">
        <div class="foct">
          <!-- <span>装卸工人</span>
        <span>[2018-06-30]</span>
        <span>3k-6k</span>
        <p>经验1-3年/无学历要求/广州-天河</p>
        <div class="row">
          <div class="col-md-4">
            <img src="../images/shouye_qiye/u645.jpg" alt="" class="mix">
          </div>
          <div class="col-md-8 mds">
            <p>广州新邦物流有限公司</p>
            <div>
              <span>张三/招聘主管</span>
              <span class="iconfont icon-xiaoxi"></span>
            </div>
          </div>

        </div> -->
        </div>
      </div>

    </div>
  </div>




  <script>

    let click1;
    let click2;

    //最新职业
    function hotjob() {
      $.ajax({
        url: '/search',
        method: 'post',
        success: (res) => {

          if (res.error) {
            console.log(res.error)
          } else {
            for (let i = 0; i < res.data.length; i++) {
              let str = `${res.data[i].j_date}`
              str = str.substring(0, 10)

              $('.foct').eq(i).html(`

                    <span>${res.data[i].job_name}</span>
                    <span>[${str}]</span>
                    <span>${res.data[i].j_money}</span>
                    <p>${res.data[i].j_year} / ${res.data[i].j_edu} / ${res.data[i].c_address}</p>
                    <div class="row">
                      <div class="col-md-4">
                        <img src="${res.data[i].c_logourl}" alt="" class="mix">
                      </div>
                      <div class="col-md-8 mds">
                        <p>${res.data[i].c_name}</p>
                        <div>
                          <span>${res.data[i].c_hrname}/招聘主管</span>
                          <span class="iconfont icon-xiaoxi"></span>
                        </div>
                      </div>
                    </div>
              `)

              $('.bode').eq(i).attr('data-id', res.data[i].j_id)


            }

          }
        }

      })
    }

    $('.sp span:nth-of-type(4)').click(function () {

      $('.sp span:nth-of-type(3)').css({
        color: '#333',
      })

      click1 = true;

      $('.sp span:nth-of-type(4)').css({
        color: "red",
      })

      $('.col .foct').html('')

      $('.col').css({
        display: 'none'
      })

      hotjob()
    })
    hotjob()

  $('#exit').click(()=>{
    sessionStorage.clear();
  })

    //点击更多
    $('#more').click(function () {
      $('.col').css({
        display: 'block'
      })
      if (click1) {
        click1 = false;
        $.ajax({
          url: '/more',
          method: 'post',
          success: (res) => {

            if (res.error) {
              console.log(res.error)
            } else {
              for (let i = 0; i < res.data2.length; i++) {
                let str = `${res.data2[i].j_date}`
                str = str.substring(0, 10)

                $('.foct').eq(i).html(`
              
                    <span>${res.data2[i].job_name}</span>
                    <span>[${str}]</span>
                    <span>${res.data2[i].j_money}</span>
                    <p>${res.data2[i].j_year}/ ${res.data2[i].j_edu} / ${res.data2[i].c_address}</p>
                    <div class="row">
                      <div class="col-md-4">
                        <img src="${res.data2[i].c_logourl}" alt="" class="mix">
                      </div>
                      <div class="col-md-8 mds">
                        <p>${res.data2[i].c_name}</p>
                        <div>
                          <span>${res.data2[i].c_hrname}/招聘主管</span>
                          <span class="iconfont icon-xiaoxi"></span>
                        </div>
                      </div>
                    </div>
              `)

                $('.bode').eq(i).attr('data-id', res.data2[i].j_id)

              }

            }
          }

        })

      }

      if (click2) {
        click2 = false;
        $.ajax({
          url: '/most',
          method: 'post',
          success: (res) => {

            if (res.error) {
              console.log(res.error)
            } else {
              for (let i = 0; i < res.data5.length; i++) {
                let str = `${res.data5[i].j_date}`
                str = str.substring(0, 10)

                $('.foct').eq(i).html(`
              
                    <span>${res.data5[i].job_name}</span>
                    <span>[${str}]</span>
                    <span>${res.data5[i].j_money}</span>
                    <p>${res.data5[i].j_year} / ${res.data5[i].j_edu} / ${res.data5[i].c_address}</p>
                    <div class="row">
                      <div class="col-md-4">
                        <img src="${res.data5[i].c_logourl}" alt="" class="mix">
                      </div>
                      <div class="col-md-8 mds">
                        <p>${res.data5[i].c_name}</p>
                        <div>
                          <span>${res.data5[i].c_hrname}/招聘主管</span>
                          <span class="iconfont icon-xiaoxi"></span>
                        </div>
                      </div>
                    </div>
              `)


                $('.bode').eq(i).attr('data-id', res.data5[i].j_id)

              }

            }
          }

        })

      }

    })

    //热门职业


    $('.sp span:nth-of-type(3)').click(function () {

      $('.col .foct').html('')

      $('.col').css({
        display: 'none'
      })



      $('.sp span:nth-of-type(3)').css({
        color: 'red',
      })

      $('.sp span:nth-of-type(4)').css({
        color: "#333",
      })
      click2 = true;
      $.ajax({
        url: '/career',
        method: 'post',
        success: (res) => {
          if (res.error) {

            console.log(res.error)
          } else {

            for (let i = 0; i < res.data4.length; i++) {
              let str = `${res.data4[i].j_date}`
              str = str.substring(0, 10)

              $('.foct').eq(i).html(`

                    <span>${res.data4[i].job_name}</span>
                    <span>[${str}]</span>
                    <span>${res.data4[i].j_money}</span>
                    <p>${res.data4[i].j_year} / ${res.data4[i].j_edu} / ${res.data4[i].c_address}</p>
                    <div class="row">
                      <div class="col-md-4">
                        <img src="${res.data4[i].c_logourl}" alt="" class="mix">
                      </div>
                      <div class="col-md-8 mds">
                        <p>${res.data4[i].c_name}</p>
                        <div>
                          <span>${res.data4[i].c_hrname}/招聘主管</span>
                          <span class="iconfont icon-xiaoxi"></span>
                        </div>
                      </div>
                    </div>
              `)

              $('.bode').eq(i).attr('data-id', res.data4[i].j_id)

            }

          }
        }
      })

    })

    //顶部

    // 个人账号id
    let id = sessionStorage.getItem('id');

    // 判断是否登录
    if (id == null) {
      $('.top .col-md-offset-4').html(
        `
      <ul>
            <li><span class="iconfont icon-lingdang"></span></li>
            <li><a href="../login.html">招聘中心</a></li>
            <li><a href="../login.html">登录</a></li>
            <li>|</li>
            <li>
                <a>注册</a>
                <ul id="zhuce">
                    <li><a href="../html/personal-register.html">个人注册</a></li>
                    <li><a href="../htmlsiness-register.html">企业注册</a></li>
                </ul>
            </li> 
        </ul>
      `
      );
    } else {
      // 根据id获取个人头像
      $.ajax({
        url: 'lectimg',
        method: 'post',
        data: { id: id },
        success: (res) => {
          $('.top .col-md-offset-4').html(
            `
                <ul>
                    <li><span class="iconfont icon-lingdang"></span></li>
                    <li id="imgLi"><img src="../images/${res.img}"></li>
                    <li><a href="">个人中心</a></li>
                    <li>|</li>
                    <li><a href="">退出登录</a></li>
                </ul>
                `
          )
        }
      });
    }


    function checkbox(item) {

      let id = item.getAttribute('data-id');
      sessionStorage.setItem('user', id);
      location.href = './gongsijianjie.html';
    }



  </script>

</body>

</html>